﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

public class Interaction
{
    private Texture2D texture, fundo;
    private Vector2 position;
    private int mapNumber;
    private List<Objects> objList;
    private int[] teleporte;
    private int area = 0;
    private List<Thought> thoughtList;
    private bool showTextSpace = true;

    public bool ShowTextSpace
    {
        get { return showTextSpace; }
        set { showTextSpace = value; }
    }

    public List<Thought> ThoughtList
    {
        get { return thoughtList; }
    }

    public int Area
    {
        get 
        {
            if (area != 0)
                return area;
            else
                return (texture.Width + texture.Height)/2;
        }
        set { area = value; }
    }

    public int[] Teleporte
    {
        get { return teleporte; }
        set { teleporte = value; }
    }

    public Rectangle BoundingRectangle
    {
        get 
        {
            if (texture == null)
                return Rectangle.Empty;
            return new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height); 
        }
    }

    public Texture2D Texture
    {
        get { return texture; }
        set { texture = value; }
    }

    public Texture2D Fundo
    {
        get { return fundo; }
        set { fundo = value; }
    }

    public List<Objects> ObjList
    {
        get { return objList; }
        set { objList = value; }
    }

    public Vector2 Position
    {
        get { return position; }
        set { position = value; }
    }

    public int MapNumber
    {
        get { return mapNumber; }
        set { mapNumber = value; }
    }

    private int interactionCounter;
    public int InteractionCounter
    {
        get { return interactionCounter; }
        set { interactionCounter = value; }
    }

    public Interaction()
    {
        teleporte = new Int32[]{};
        interactionCounter = 0;
        objList = new List<Objects>();
        thoughtList = new List<Thought>();
    }

    public void Draw(GameTime gameTime, SpriteBatch spriteBatch, int px, int py)
    {
        if (texture == null)
            return;
        spriteBatch.Draw(texture, new Vector2(Globals.ScreenWidth2 - (px - position.X), Globals.ScreenHeight2 - (py - position.Y)), Color.White);
    }

    internal void AddThought(Thought thought)
    {
        thoughtList.Add(thought);
    }
}
